#pragma once
#include "DXAMLCommon.h"
#include "IErrorServiceListener.h"
#include "IError.h"



struct ICoreServices;
struct IDependencyObject;


struct IErrorService
{
public: 
	virtual XUINT32 AddRef() = 0;
	virtual XUINT32 Release() = 0;
	virtual HRESULT AddListener(struct IErrorServiceListener * pListener) = 0;
	virtual HRESULT RemoveListener(struct IErrorServiceListener * pListener) = 0;
	virtual HRESULT GetMessageFromErrorCode(XUINT32 iErrorID, XCHAR * * ppMessage, XUINT32 * pcMessage) = 0;
	virtual HRESULT GetLastReportedError(struct IError * * ppError) = 0;
	virtual HRESULT GetFirstError(struct IError * * ppError) = 0;
	virtual HRESULT AddError(struct IError * pErrorObject) = 0;
	virtual HRESULT CleanupLastError(struct IError * pError) = 0;
	virtual void CleanupErrors() = 0;
	virtual void CoreResetCleanup(struct ICoreServices * pCore) = 0;
	virtual HRESULT ReportGenericError(enum ErrorType eType, XUINT32 iErrorCode, XBOOL bRecoverable, XUINT32 uLineNumber, XUINT32 uCharPosition, struct XSTRING * * ppParam, XUINT32 cParams, struct Xcp_IDependencyObject * pErrorEventArgs, struct Xcp_IDependencyObject * pSender) = 0;
	virtual HRESULT ReportParserError(XUINT32 iErrorCode, XBOOL bRecoverable, CXString * pstrXamlFileName, CXString * pstrXmlElement, CXString * pstrXmlAttribute, XUINT32 uLineNumber, XUINT32 uCharPosition, CXString * pstrMessage, struct XSTRING * * ppParam, XUINT32 cParams) = 0;
	virtual HRESULT ReportRuntimeError(XUINT32 iErrorCode, XBOOL bRecoverable, XUINT32 uLineNumber, XUINT32 uCharPosition, CXString * pstrMethodName, struct XSTRING * * ppParam, XUINT32 cParams, struct Xcp_IDependencyObject * pErrorEventArgs, struct Xcp_IDependencyObject * pSender, XUINT32 cMessage, XCHAR * pErrorMessage) = 0;
	virtual HRESULT ReportManagedError(XUINT32 bRecoverable, XBOOL cMessage, XCHAR * pErrorMessage) = 0;
};
